package com.asen.commons.core.base.service;

import com.asen.commons.core.base.domain.BaseEntry;

import java.util.List;

/**
 * 通用分录service接口
 *
 * @author Gary
 * @version 1.0
 * @date 2018-12-13
 */
public interface BaseEntryService<T extends BaseEntry> extends SubBaseService<T> {

    /**
     * 新增分录
     *
     * @param entryList
     * @param parentId
     * @throws Exception
     */
    void addEntry(List<T> entryList, Long parentId) throws Exception;

    /**
     * 更新分录
     *
     * @param entryList
     * @param parentId
     * @throws Exception
     */
    void updateEntry(List<T> entryList, Long parentId) throws Exception;

    /**
     * 删除分录
     *
     * @param parentId
     * @throws Exception
     */
    void removeEntry(Long parentId) throws Exception;

    /**
     * 根据父id获取分录数据
     *
     * @param parentId
     * @return
     * @throws Exception
     */
    List<T> getListByParentId(Long parentId) throws Exception;

}
